package org.vison.wonfu.framework.test.admin.integration;

import com.github.pagehelper.PageInfo;
import org.vison.wonfu.framework.BaseRes;
import org.vison.wonfu.framework.soa.annotation.HttpMethod;
import org.vison.wonfu.framework.soa.annotation.SOAParamsMode;
import org.vison.wonfu.framework.soa.annotation.SoaMethod;
import org.vison.wonfu.framework.soa.annotation.SoaRequestMethod;
import org.vison.wonfu.framework.test.admin.controller.req.AdminAddReq;
import org.vison.wonfu.framework.test.admin.controller.req.AdminUpdateReq;
import org.vison.wonfu.framework.test.admin.controller.req.LoginReq;
import org.vison.wonfu.framework.test.admin.controller.res.AdminDetailRes;
import org.vison.wonfu.framework.test.admin.controller.res.LoginInfo;
import org.vison.wonfu.framework.test.admin.controller.res.LoginRes;
import org.vison.wonfu.framework.test.admin.dao.entity.AdminPO;
import org.vison.wonfu.framework.test.admin.integration.model.DetailReq;
import org.vison.wonfu.framework.test.admin.integration.model.ListReq;

public interface AdminSoaRef {

    @SoaMethod(path = "/login", http = @HttpMethod(method = SoaRequestMethod.POST, paramsMode = SOAParamsMode.BODY_JSON))
    BaseRes<LoginRes> login(LoginReq req);
    
    @SoaMethod(path = "/info", http = @HttpMethod(method = SoaRequestMethod.POST, paramsMode = SOAParamsMode.BODY_JSON))
    BaseRes<LoginInfo> loginInfo();
    
    @SoaMethod(path = "/list", http = @HttpMethod(method = SoaRequestMethod.GET, paramsMode = SOAParamsMode.PARAMS))
    BaseRes<PageInfo<AdminPO>> list(ListReq listReq);
    
    @SoaMethod(path = "/detail/{id}", http = @HttpMethod(method = SoaRequestMethod.GET,paramsMode = SOAParamsMode.PARAMS))
    BaseRes<AdminDetailRes> detail(DetailReq req);
    
    @SoaMethod(path = "/add", http = @HttpMethod(method = SoaRequestMethod.POST, paramsMode = SOAParamsMode.BODY_JSON))
    BaseRes<Long> add(AdminAddReq req);
    
    @SoaMethod(path = "/update", http = @HttpMethod(method = SoaRequestMethod.POST, paramsMode = SOAParamsMode.BODY_JSON))
    BaseRes<Boolean> update(AdminUpdateReq req);
    
    @SoaMethod(path = "/delete", http = @HttpMethod(method = SoaRequestMethod.POST))
    BaseRes<Boolean> delete(Long id);
}